package ma.cdm.compteRendu.configuration;

import javax.activation.MimetypesFileTypeMap;

import ma.cdm.flex.messaging.CustomFlexSessionListener;
import flex.messaging.FlexSession;

public class CRConfiguration {

	public static final String LDAP_IMAGE_URL = "LDAP.IMAGE.URL";

	public static final String LDAP_PROVIDER_URL = "LDAP.PROVIDER_URL";

	public static final String LDAP_USERS_DN = "LDAP.USERS.DN";

	public static final String LDAP_UNITS_DN = "LDAP.UNITS.DN";
	
	public static final String MAIL_HOST = "MAIL.HOST";
	
	public static final String MAIL_PORT = "MAIL.PORT";
	
	public static final String MAIL_USERNAME = "MAIL.USERNAME";
	
	public static final String MAIL_PASSWORD = "MAIL.PASSWORD";
	
	public static final String MAIL_ENCODING = "MAIL.ENCODING";
	
	public static final String ATTACHEMENT_REPO="ATTACHEMENT.REPO";
     
	public static MimetypesFileTypeMap mediaTypes ;
	
	 static{
	    	mediaTypes = new MimetypesFileTypeMap();
	    	mediaTypes.addMimeTypes("application/msword doc");
		    mediaTypes.addMimeTypes("application/vnd.ms-excel xls");
		    mediaTypes.addMimeTypes("application/pdf pdf");
		    mediaTypes.addMimeTypes("application/pcl pcl");
		    mediaTypes.addMimeTypes("text/richtext rtx");
		    mediaTypes.addMimeTypes("text/csv csv");
		    mediaTypes.addMimeTypes("text/tab-separated-values tsv tab");
		    mediaTypes.addMimeTypes("application/x-vnd.oasis.opendocument.spreadsheet ods");
		    mediaTypes.addMimeTypes("application/vnd.oasis.opendocument.text odt");
		    mediaTypes.addMimeTypes("application/vnd.ms-powerpoint ppt pps pot");
		    mediaTypes.addMimeTypes("application/vnd.openxmlformats-officedocument.wordprocessingml.document docx");
		    mediaTypes.addMimeTypes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx");
		    mediaTypes.addMimeTypes("audio/mpeg mp3 mpeg3");
		    mediaTypes.addMimeTypes("image/png png");
		    mediaTypes.addMimeTypes("application/zip zip");
		    mediaTypes.addMimeTypes("application/x-tar tar");
		    mediaTypes.addMimeTypes("video/quicktime qt mov moov");
		    mediaTypes.addMimeTypes("video/mpeg mpeg mpg mpe mpv vbs mpegv");
		    mediaTypes.addMimeTypes("video/msvideo avi");
		    mediaTypes.addMimeTypes("application/smil smi sml smil");
		    mediaTypes.addMimeTypes("image/jpeg jpeg jpg jpe");
		    mediaTypes.addMimeTypes("image/gif gif");
			mediaTypes.addMimeTypes("image/png png");
			mediaTypes.addMimeTypes("image/bmp bmp");
			mediaTypes.addMimeTypes("audio/amr amr");
			mediaTypes.addMimeTypes("audio/basic au");
			mediaTypes.addMimeTypes("audio/midi midi mid");
			mediaTypes.addMimeTypes("audio/x-wav wav");
			mediaTypes.addMimeTypes("audio/basic au");
			mediaTypes.addMimeTypes("audio/mpeg mp3");
			mediaTypes.addMimeTypes("video/3gpp 3gp");
			mediaTypes.addMimeTypes("video/mpeg mpeg");
			mediaTypes.addMimeTypes("video/mp4 mp4");
			mediaTypes.addMimeTypes("video/vnd.rn-realvideo rv");
			mediaTypes.addMimeTypes("text/plain txt");
			mediaTypes.addMimeTypes("textwf/plain txtwf");			
	    }
	 
	public void initApplication()
	{
		FlexSession.addSessionCreatedListener(new CustomFlexSessionListener());
	}
}
